package org.xxpay.core.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.io.Serializable;
import java.util.Date;

/**
 * 用户语言偏好实体类
 * 
 * @author xxpay
 */
@TableName("t_user_locale")
public class UserLocale implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 主键ID
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 用户ID
     */
    private Long userId;

    /**
     * 用户类型：1-管理员，2-商户，3-代理商
     */
    private Byte userType;

    /**
     * 语言偏好：zh_CN-中文，en_US-英文
     */
    private String locale;

    /**
     * 创建时间
     */
    private Date createTime;

    /**
     * 更新时间
     */
    private Date updateTime;

    // 用户类型常量
    public static final byte USER_TYPE_ADMIN = 1;
    public static final byte USER_TYPE_MERCHANT = 2;
    public static final byte USER_TYPE_AGENT = 3;

    // 语言常量
    public static final String LOCALE_ZH_CN = "zh_CN";
    public static final String LOCALE_EN_US = "en_US";

    public UserLocale() {
    }

    public UserLocale(Long userId, Byte userType, String locale) {
        this.userId = userId;
        this.userType = userType;
        this.locale = locale;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Long getUserId() {
        return userId;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }

    public Byte getUserType() {
        return userType;
    }

    public void setUserType(Byte userType) {
        this.userType = userType;
    }

    public String getLocale() {
        return locale;
    }

    public void setLocale(String locale) {
        this.locale = locale;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    @Override
    public String toString() {
        return "UserLocale{" +
                "id=" + id +
                ", userId=" + userId +
                ", userType=" + userType +
                ", locale='" + locale + '\'' +
                ", createTime=" + createTime +
                ", updateTime=" + updateTime +
                '}';
    }
}
